package com.example.cslp.mapper;


import com.example.cslp.pojo.entity.Notice;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NoticeMapper {
    //创建公告
    @Insert("insert into notice(title,content,founder,create_date) values (#{title},#{content},#{founder},#{create_date})")
     Boolean createNotice(Notice notice);

    //编辑公告
    @Update("update notice set title=#{title},content=#{content},create_date=#{create_date} where id=#{id}")
    Boolean editNotice(Notice notice);

    //查询公告
    @Select("select * from notice")
    List<Notice> queryNotice();

    //删除公告
    @Delete("delete from notice where id=#{id}")
    Boolean deleteNotice(Notice notice);
}
